﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="JT_TitleSortAdd.aspx.cs" Inherits="JTicket.UI.JT_TitleSortAdd" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
    //页面初始下载
    $(document).ready(function () {
        if (Flag == "Edite") {
            $("#BtnAdd").hide();

            JTicket.UI.Service.JT_CodeNote.GetModel(ID,
            function Success(Reuslt) {
                if (Reuslt != null) { 
                    $("#txtCodeNote").val(Reuslt.CodeNote);
                    $("#txtCodeVal").val(Reuslt.CodeVal); 
                } else { window.location.href = "JT_TitleSortManager.aspx"; }
            },
            function Fail(Reuslt) { isAlertError(); });

        } else { $("#BtnEdite").hide(); }
    });
    //添加
    function Add() {
        if ($('#txtCodeNote').val() == "") {
            alert("请输入类别名称"); $("#txtCodeNote").focus(); return false;
        }
        if ($('#txtCodeVal').val() == "") {
            alert("请输入类别编号"); $("#txtCodeVal").focus(); return false;
        }
        JTicket.UI.Service.JT_CodeNote.AddTitleSort(
        $("#txtCodeNote").val(),
        $("#txtCodeVal").val(),
    function Success(Result)
    { alert(Result); }, isAlertError);
    }
    //修改
    function Update() {
        if ($('#txtCodeNote').val() == "") {
            alert("请输入类别名称"); $("#txtCodeNote").focus(); return false;
        }
        if ($('#txtCodeVal').val() == "") {
            alert("请输入类别编号"); $("#txtCodeVal").focus(); return false;
        }
        JTicket.UI.Service.JT_CodeNote.Update(
        $("#txtCodeNote").val(),
        $("#txtCodeVal").val(),
    function Success()
    { alert("修改成功"); }, isAlertError);
    }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <asp:ScriptManager ID="sm" runat="server">
        <Services>
            <asp:ServiceReference InlineScript="true" Path="~/Service/JT_CodeNote.asmx" />
        </Services>
    </asp:ScriptManager>
    <table align="center" border="0" cellpadding="4" cellspacing="1" class="toptable grid"
        width="100%">
        <tr>
            <td class="category t2" height="25" width="100">
                演出类别添加
            </td>
            <td class="category" height="25">
            </td>
        </tr>
    </table>
    <table cellpadding="1" cellspacing="1" id="TbInfo" class="TbInfo">
        <tr>
            <td align="right" bgcolor="#3890B5" class="B" style="width: 130px">
                名称
            </td>
            <td height="25" align="right" bgcolor="#3890B5" class="B">
                操作
            </td>
            <td align="right" bgcolor="#3890B5" class="B" style="width: 50px">
                说明
            </td>
        </tr>
        <tr>
            <td align="center" bgcolor="#F6F6F6" style="width: 130px; height: 25px;">
                类别编号：</td>
            <td align="left" bgcolor="#F6F6F6" style="height: 25px">
                <input id="txtCodeVal" type="text" /></td>
            <td bgcolor="#F6F6F6" style="height: 25px; width: 171px;">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="center" bgcolor="#F6F6F6" style="width: 130px; height: 25px;">
                类别名称：
            </td>
            <td align="left" bgcolor="#F6F6F6" style="height: 25px">
                <input id="txtCodeNote" type="text" />
            </td>
            <td bgcolor="#F6F6F6" style="height: 25px; width: 171px;">
                必填
             </td>
        </tr>
        <tr>
            <td align="center" bgcolor="#F6F6F6" style="width: 130px">
            </td>
            <td height="25" bgcolor="#F6F6F6" align="center">
                <input type="button" id="BtnAdd" value="添  加" onclick="Add();" onmousemove="showBtnOver(this)"
                    onmouseout="showBtnOut(this)" class="submitMiniGreen" />
                <input type="button" id="BtnEdite" value="修  改" onclick="Update();" onmousemove="showBtnOver(this)"
                    onmouseout="showBtnOut(this)" class="submitMiniGreen" />
                <input type="button" id="BtnBack" value="返  回" onclick="javascript:window.location.href ='JT_TitleSortManager.aspx'"
                    onmousemove="showBtnOver(this)" onmouseout="showBtnOut(this)" class="submitMiniGreen" />
            </td>
            <td bgcolor="#F6F6F6" style="width: 171px">
                &nbsp;
            </td>
        </tr>
    </table>
</asp:Content>
